import socket
import sys
import json

host = 'localhost'
port = 60000
size = 1024
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((host,port))

msg1 = "" 

while 1:
    # read from keyboard
    line = sys.stdin.readline()
    if line == '\n':
        break
    #line = "This the message"#json.dumps(tel)#, f, indent = 0)
    print "Sending this data: ",line
    s.send(line)
    data = s.recv(size)
    print "Got the data from the server: "
    sys.stdout.write(data)
    sys.stdout.write('%')
s.close()
